import Vue from "vue";
import Router from 'vue-router';

// import Home from '../components/Home.vue';

Vue.use(Router)
export default new Router({
  routes:[
    {
      path:'/',
      redirect:'/login',
      name:'首页',
      hidden:true,
      component:()=>import('@/components/Login')
    },
    {
      path:'/login',
      name:'Login',
      hidden:true,
      component:()=>import('@/components/Login')
    },
    {
      path:'*',
      name:'NoteFound',
      hidden:true,
      component:()=>import('@/components/NoteFound')
    },
    // {
    //   path:'/home',
    //   name:'Home',
    //   // component:Home
    //   // component:()=>import('@/components/Home')路由懒加载得配置
    //   //异步组件得配置
    //   component:resolve=>require(['@/components/Home'],resolve)
    // },
    {
      path:'/home',
      name:'学生管理',
      redirect:'/home/student',
      iconClass:'fa fa-users',
      component:()=>import('@/components/Home'),
      children:[
        {
          path:'/home/student',
          name:'学生列表',
          iconClass:'fa fa-list',
          component:()=>import('@/components/Students/StudentList')
        },
        {
          path:'/home/info',
          name:'信息列表',
          iconClass:'fa fa-list-alt',
          component:()=>import('@/components/Students/infoList')
        },
        {
          path:'/home/infos',
          name:'学生列表',
          iconClass:'fa fa-list-alt',
          component:()=>import('@/components/Students/infoLists')
        },
        {
          path:'/home/work',
          name:'作业列表',
          iconClass:'fa fa-list-ul',
          component:()=>import('@/components/Students/WorkList')
        },
        {
          path:'/home/works',
          name:'作业管理',
          iconClass:'fa fa-th-list',
          component:()=>import('@/components/Students/WorkMent')
        },
      ]
    },
    {
      path:'/home',
      name:'数据分析',
      iconClass:'fa fa-bar-chart',
      component:()=>import('@/components/Home'),
      children:[
        {
          path:'/home/dataview',
          name:'数据概览',
          iconClass:'fa fa-line-chart',
          component:()=>import('@/components/dataAnalysis/DataView')
        },
        {
          path:'/home/mapview',
          name:'地图概览',
          iconClass:'fa fa-line-chart',
          component:()=>import('@/components/dataAnalysis/MapView')
        },
        {
          path:'/home/trave',
          name:'旅游地图',
          iconClass:'fa fa-line-chart',
          component:()=>import('@/components/dataAnalysis/TravelMap')
        },
        {
          path:'/home/score',
          name:'分数地图',
          iconClass:'fa fa-line-chart',
          component:()=>import('@/components/dataAnalysis/ScoreMap')
        },
      ]
    },
    {
      path:'/users',
      name:'用户中心',
      iconClass:'fa fa-user',
      component:()=>import('@/components/Home'),
      children:[
        {
          path:'/users/user',
          name:'权限管理',
          iconClass:'fa fa-user',
          component:()=>import('@/components/users/User')
        },
      ]
    },
  ],
  mode:'history'
})